stack = []
s = "( () {} [ <> ] )"

for i in s:
    if i in  "({[<" :
        stack.append(i)
    else:
        if i == ")" and stack [-1] ==" ( " :
            stack.pop()
    elif i == "}" and stack [-1] ==" { " :
        stack.pop()
    elif i == " ] " and stack [-1] ==" [ " :
            stack.pop()
    elif i == " > " and stack [-1] ==" < " :
            stack.pop()
        else:
            break
print("false")
